Skip to content

Develop#323

Merged
simonoppowa merged 45 commits intomainfrom
develop
Apr 12, 2026
Merged

Develop#323
simonoppowa merged 45 commits intomainfrom
develop

Conversation

@simonoppowa
Copy link
Copy Markdown
Owner

No description provided.

contusionglory and others added 30 commits May 25, 2025 19:04
Italian translation
Translation to Czech language, increased limits of recently input data (intake, activities)
# Conflicts:
#	lib/features/edit_meal/presentation/edit_meal_screen.dart
…d-reset

fix(edit_meal): prevent keyboard drop; scope rebuilds; correct unit suffix; safe conversions & controller disposal
Updated GettingStarted docs.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR primarily reformats large portions of the Dart codebase, expands localization output, and adjusts some UI/input behaviors (e.g., height/weight pickers), alongside updates to developer tooling/docs and CI configuration.

Changes:

  • Large-scale Dart formatting/constructor style updates across UI, blocs, entities, repositories, and datasources.
  • Localization updates (new labels + generated intl artifacts) and new developer tooling for regenerating intl files.
  • Data/parsing and UX tweaks (OFF nutriments nullable handling, picker min bounds), plus workflow/docs changes.

Reviewed changes

Copilot reviewed 185 out of 195 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
test/widget_test/widget_test.dart Formatting-only updates to widget test layout.
test/unit_test/tdee_calc_test.dart Formatting-only updates to unit tests.
test/unit_test/met_calc_test.dart Formatting-only updates to unit tests.
test/unit_test/intake_repository_test.dart Formatting-only updates to unit tests.
test/unit_test/calorie_goal_calc_test.dart Formatting-only updates to unit tests.
test/fixture/user_entity_fixtures.dart Formatting-only updates to fixtures.
test/fixture/physical_activity_entity_fixtures.dart Formatting-only updates to fixtures.
test/fixture/meal_entity_fixtures.dart Formatting-only updates to fixtures.
README.md Adds contributors section; adjusts “Getting Started” heading wording.
pubspec.yaml Version bump; adds intl_translation dependency.
lib/main.dart Formatting-only updates to Sentry init and app wiring.
lib/l10n/intl_en.arb Adds kcalTooMuchLabel.
lib/l10n/intl_de.arb Adds settingsMetricLabel and kcalTooMuchLabel.
lib/generated/l10n.dart Generated localization updates incl. new supported locales.
lib/generated/intl/messages_en.dart Generated messages update for new labels.
lib/generated/intl/messages_de.dart Generated messages update for new labels.
lib/generated/intl/messages_all.dart Generated locale registry updated (cz/it/uk).
lib/features/settings/presentation/widgets/export_import_dialog.dart Formatting-only widget layout changes.
lib/features/settings/presentation/widgets/calculations_dialog.dart Formatting-only changes; minor layout consolidation.
lib/features/settings/presentation/bloc/settings_state.dart Formatting-only constructor/props style change.
lib/features/settings/presentation/bloc/settings_bloc.dart Formatting + tracked-day update logic touched.
lib/features/settings/presentation/bloc/export_import_state.dart Minor whitespace cleanup.
lib/features/settings/presentation/bloc/export_import_bloc.dart Formatting-only changes.
lib/features/settings/domain/usecase/import_data_usecase.dart Formatting-only changes.
lib/features/settings/domain/usecase/export_data_usecase.dart Formatting-only changes.
lib/features/scanner/scanner_screen.dart Formatting-only changes to navigation and scanner callbacks.
lib/features/scanner/presentation/scanner_state.dart Formatting-only constructor style change.
lib/features/scanner/presentation/scanner_bloc.dart Formatting-only changes.
lib/features/profile/profile_page.dart Formatting-only changes; some widget simplifications.
lib/features/profile/presentation/widgets/set_weight_dialog.dart Converts to StatefulWidget; prevents negative picker values.
lib/features/profile/presentation/widgets/set_height_dialog.dart Converts to StatefulWidget; prevents negative picker values.
lib/features/profile/presentation/widgets/set_gender_dialog.dart Minor formatting fix (missing trailing comma).
lib/features/profile/presentation/bloc/profile_state.dart Formatting-only constructor style change.
lib/features/profile/presentation/bloc/profile_bloc.dart Formatting-only changes.
lib/features/onboarding/presentation/widgets/onboarding_overview_page_body.dart Formatting-only changes.
lib/features/onboarding/presentation/widgets/onboarding_fourth_page_body.dart Formatting-only changes.
lib/features/onboarding/presentation/widgets/onboarding_first_page_body.dart Formatting-only changes.
lib/features/onboarding/presentation/widgets/highlight_button.dart Formatting-only changes.
lib/features/onboarding/presentation/onboarding_intro_page_body.dart Formatting-only changes.
lib/features/onboarding/presentation/bloc/onboarding_bloc.dart Formatting-only changes.
lib/features/onboarding/domain/entity/user_goal_selection_entity.dart Enum formatting condensed to one line.
lib/features/onboarding/domain/entity/user_gender_selection_entity.dart Enum formatting condensed to one line.
lib/features/onboarding/domain/entity/user_data_mask_entity.dart Formatting-only constructor style change.
lib/features/onboarding/domain/entity/user_activity_selection_entity.dart Enum formatting condensed to one line.
lib/features/meal_detail/presentation/widgets/off_disclaimer.dart Formatting-only changes.
lib/features/meal_detail/presentation/widgets/meal_title_expanded.dart Formatting-only changes to rich text span layout.
lib/features/meal_detail/presentation/widgets/meal_placeholder.dart Formatting-only changes.
lib/features/meal_detail/presentation/widgets/meal_info_button.dart Formatting-only changes.
lib/features/meal_detail/presentation/widgets/meal_detail_nutriments_table.dart Formatting-only changes (table row construction).
lib/features/meal_detail/presentation/widgets/meal_detail_macro_nutrients.dart Formatting-only changes.
lib/features/meal_detail/presentation/bloc/meal_detail_state.dart Formatting-only constructor/props style change.
lib/features/meal_detail/presentation/bloc/meal_detail_event.dart Formatting-only constructor/props style change.
lib/features/meal_detail/presentation/bloc/meal_detail_bloc.dart Formatting-only changes; minor parse formatting.
lib/features/home/presentation/widgets/macro_nutriments_widget.dart Formatting-only changes.
lib/features/home/presentation/bloc/home_state.dart Formatting-only (trailing comma).
lib/features/edit_meal/presentation/bloc/edit_meal_event.dart Minor whitespace cleanup.
lib/features/edit_meal/presentation/bloc/edit_meal_bloc.dart Formatting-only changes to entity creation logic.
lib/features/diary/presentation/widgets/diary_table_calendar.dart Formatting-only changes.
lib/features/diary/presentation/bloc/diary_bloc.dart Formatting-only changes.
lib/features/diary/presentation/bloc/calendar_day_state.dart Formatting-only constructor style change.
lib/features/diary/presentation/bloc/calendar_day_event.dart Minor whitespace cleanup.
lib/features/diary/presentation/bloc/calendar_day_bloc.dart Formatting-only changes.
lib/features/diary/diary_page.dart Formatting-only changes.
lib/features/add_meal/presentation/widgets/no_results_widget.dart Formatting-only changes.
lib/features/add_meal/presentation/widgets/meal_search_bar.dart Formatting-only changes.
lib/features/add_meal/presentation/widgets/meal_item_card.dart Formatting-only changes.
lib/features/add_meal/presentation/bloc/recent_meal_state.dart Formatting-only constructor style change.
lib/features/add_meal/presentation/bloc/recent_meal_bloc.dart Formatting-only changes.
lib/features/add_meal/presentation/bloc/products_state.dart Formatting-only constructor style change.
lib/features/add_meal/presentation/bloc/products_bloc.dart Formatting-only changes.
lib/features/add_meal/presentation/bloc/food_bloc.dart Formatting-only changes.
lib/features/add_meal/presentation/add_meal_type.dart Enum formatting condensed to one line.
lib/features/add_meal/domain/usecase/search_products_usecase.dart Formatting-only changes.
lib/features/add_meal/data/repository/products_repository.dart Filters OFF products with null nutriments; formatting changes.
lib/features/add_meal/data/dto/off/off_word_response_dto.dart Formatting-only constructor style change.
lib/features/add_meal/data/dto/off/off_product_response_dto.dart Formatting-only constructor style change.
lib/features/add_meal/data/dto/off/off_product_dto.g.dart Makes nutriments nullable in JSON parsing.
lib/features/add_meal/data/dto/off/off_product_dto.dart Updates DTO field type for nullable nutriments; formatting.
lib/features/add_meal/data/dto/fdc/fdc_word_response_dto.dart Formatting-only constructor style change.
lib/features/add_meal/data/dto/fdc/fdc_food_dto.dart Formatting-only constructor style change.
lib/features/add_meal/data/dto/fdc/fdc_const.dart Trailing commas in lists/maps.
lib/features/add_meal/data/dto/fdc_sp/sp_fdc_portion_dto.dart Formatting-only constructor style change.
lib/features/add_meal/data/dto/fdc_sp/sp_fdc_food_dto.dart Formatting-only changes to getters/constructor.
lib/features/add_meal/data/dto/fdc_sp/sp_const.dart Formatting-only changes.
lib/features/add_meal/data/data_sources/sp_fdc_data_source.dart Formatting-only changes.
lib/features/add_meal/data/data_sources/off_data_source.dart Increases timeout; formatting changes.
lib/features/add_meal/data/data_sources/fdc_data_source.dart Formatting-only changes.
lib/features/add_activity/presentation/widgets/activity_item_card.dart Formatting-only changes.
lib/features/add_activity/presentation/bloc/recent_activities_event.dart Minor whitespace cleanup.
lib/features/add_activity/presentation/bloc/recent_activities_bloc.dart Formatting-only changes.
lib/features/add_activity/presentation/bloc/activities_event.dart Formatting-only constructor style change.
lib/features/add_activity/presentation/add_activity_screen.dart Formatting-only changes.
lib/features/activity_detail/presentation/widget/activity_title_expanded.dart Formatting-only changes.
lib/features/activity_detail/presentation/widget/activity_info_button.dart Formatting-only changes.
lib/features/activity_detail/presentation/widget/activity_detail_bottom_sheet.dart Formatting-only changes.
lib/features/activity_detail/presentation/bloc/activity_detail_state.dart Formatting-only changes.
lib/features/activity_detail/presentation/bloc/activity_detail_bloc.dart Formatting-only changes.
lib/core/utils/vertical_list_popup_menu_selections.dart Enum formatting condensed to one line.
lib/core/utils/secure_app_storage_provider.dart Formatting-only changes.
lib/core/utils/off_const.dart Formatting-only changes.
lib/core/utils/logger_config.dart Formatting-only changes.
lib/core/utils/hive_db_provider.dart Formatting-only changes.
lib/core/utils/extensions.dart Formatting-only changes.
lib/core/utils/custom_text_input_formatter.dart Formatting-only changes.
lib/core/utils/calc/tdee_calc.dart Formatting-only changes.
lib/core/utils/calc/met_calc.dart Formatting-only changes.
lib/core/utils/calc/macro_calc.dart Formatting-only changes.
lib/core/utils/calc/calorie_goal_calc.dart Formatting-only changes.
lib/core/styles/fonts.dart Formatting-only changes.
lib/core/presentation/widgets/placeholder_card.dart Formatting-only changes.
lib/core/presentation/widgets/main_appbar.dart Formatting-only changes.
lib/core/presentation/widgets/intake_card.dart Formatting-only changes.
lib/core/presentation/widgets/info_dialog.dart Formatting-only changes.
lib/core/presentation/widgets/image_full_screen.dart Formatting-only changes.
lib/core/presentation/widgets/home_appbar.dart Formatting-only changes.
lib/core/presentation/widgets/error_dialog.dart Formatting-only changes.
lib/core/presentation/widgets/edit_dialog.dart Formatting-only changes.
lib/core/presentation/widgets/dynamic_ont_logo.dart Formatting-only changes.
lib/core/presentation/widgets/disclaimer_dialog.dart Formatting-only changes.
lib/core/presentation/widgets/delete_dialog.dart Formatting-only changes.
lib/core/presentation/widgets/delete_all_dialog.dart Formatting-only changes.
lib/core/presentation/widgets/copy_or_delete_dialog.dart Formatting-only changes.
lib/core/presentation/widgets/copy_dialog.dart Formatting-only changes.
lib/core/presentation/widgets/app_banner_version.dart Formatting-only changes.
lib/core/presentation/widgets/activity_vertial_list.dart Formatting-only changes.
lib/core/presentation/widgets/activity_card.dart Formatting-only changes.
lib/core/presentation/main_screen.dart Formatting-only changes.
lib/core/domain/usecase/update_intake_usecase.dart Formatting-only changes.
lib/core/domain/usecase/get_tracked_day_usecase.dart Formatting-only changes.
lib/core/domain/usecase/get_macro_goal_usecase.dart Formatting-only changes.
lib/core/domain/usecase/get_kcal_goal_usecase.dart Formatting-only changes.
lib/core/domain/usecase/get_intake_usecase.dart Formatting-only changes.
lib/core/domain/usecase/add_tracked_day_usecase.dart Formatting-only changes.
lib/core/domain/usecase/add_config_usecase.dart Formatting-only changes.
lib/core/domain/entity/user_weight_goal_entity.dart Formatting-only changes.
lib/core/domain/entity/user_entity.dart Formatting-only changes; minor age spacing change.
lib/core/domain/entity/user_bmi_entity.dart Formatting-only changes.
lib/core/domain/entity/user_activity_entity.dart Formatting-only changes.
lib/core/domain/entity/tracked_day_entity.dart Formatting-only changes; minor signature formatting.
lib/core/domain/entity/physical_activity_entity.dart Formatting-only changes.
lib/core/domain/entity/intake_entity.dart Formatting-only changes.
lib/core/domain/entity/config_entity.dart Formatting-only changes.
lib/core/domain/entity/app_theme_entity.dart Formatting-only changes.
lib/core/data/repository/user_activity_repository.dart Formatting-only changes.
lib/core/data/repository/tracked_day_repository.dart Formatting-only changes.
lib/core/data/repository/intake_repository.dart Formatting-only changes.
lib/core/data/repository/config_repository.dart Formatting-only changes.
lib/core/data/dbo/user_weight_goal_dbo.dart Formatting-only changes.
lib/core/data/dbo/user_dbo.dart Formatting-only changes.
lib/core/data/dbo/tracked_day_dbo.dart Formatting-only changes.
lib/core/data/dbo/physical_activity_dbo.dart Formatting-only changes.
lib/core/data/dbo/meal_nutriments_dbo.dart Formatting-only changes.
lib/core/data/dbo/meal_dbo.dart Formatting-only changes.
lib/core/data/dbo/intake_dbo.dart Formatting-only changes.
lib/core/data/dbo/config_dbo.dart Formatting-only changes.
lib/core/data/dbo/app_theme_dbo.dart Formatting-only changes.
lib/core/data/data_source/user_data_source.dart Formatting-only changes.
lib/core/data/data_source/user_activity_dbo.dart Formatting-only changes.
lib/core/data/data_source/user_activity_data_source.dart Changes recent-activity default limit; sorting logic touched.
lib/core/data/data_source/tracked_day_data_source.dart Formatting-only changes.
lib/core/data/data_source/intake_data_source.dart Changes update logic formatting; increases recent-intake default limit.
lib/core/data/data_source/config_data_source.dart Formatting-only changes.
justfile Adds just recipes (format, intl regen/check, ci).
GettingStarted.md Rewrites setup guide content; includes new Windows/Android steps.
analysis_options.yaml Excludes generated intl files from analyzer warnings.
.metadata Flutter tool metadata updated (revision/channel/platforms).
.github/workflows/default_workflow.yml Adds just install; comments out CI execution.
Comments suppressed due to low confidence (2)

.github/workflows/default_workflow.yml:53

  • The GitHub Actions workflow no longer runs any build/analyze/test steps because the CI step is commented out. This effectively disables CI for PRs and pushes; please re-enable the just ci (or equivalent) step(s) so failures are caught automatically.
#      - name: Run CI
#        run: just ci
#        env:
#          FDC_API_KEY: ${{ secrets.FDC_API_KEY }}
#          SENTRY_DNS: ${{ secrets.SENTRY_DNS }}
#          SUPABASE_PROJECT_ANON_KEY: ${{ secrets.SUPABASE_PROJECT_ANON_KEY }}
#          SUPABASE_PROJECT_URL: ${{ secrets.SUPABASE_PROJECT_URL }}

lib/core/data/data_source/intake_data_source.dart:90

  • getRecentlyAddedIntake defaults to returning up to 100000 items, and IntakeRepository.getRecentIntake() calls it without overriding number. This can cause significant memory/CPU usage as the database grows; consider using a much smaller default and/or requiring callers to pass an explicit limit.
  Future<List<IntakeDBO>> getRecentlyAddedIntake({int number = 100000}) async {
    final intakeList = _intakeBox.values.toList();

    //  sort list by date (newest first) and filter unique intake
    intakeList.sort((a, b) => (-1) * a.dateTime.compareTo(b.dateTime));

    final filterCodes = <String>{};
    final uniqueIntake = intakeList
        .where(
          (intake) =>
              filterCodes.add(intake.meal.code ?? intake.meal.name ?? ""),
        )
        .toList();

    return uniqueIntake.take(number).toList();
  }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/features/settings/presentation/bloc/settings_bloc.dart
Comment on lines +46 to +53
Future<List<UserActivityDBO>> getRecentlyAddedUserActivity(
{int number = 20}) async {
{int number = 100}) async {
final userActivities = _userActivityBox.values.toList().reversed;

// sort list by date and filter unique activities
userActivities
.toList()
.sort((a, b) => a.date.toString().compareTo(b.date.toString()));
userActivities.toList().sort(
(a, b) => a.date.toString().compareTo(b.date.toString()),
);
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getRecentlyAddedUserActivity attempts to sort via userActivities.toList().sort(...), but that sorts a temporary list and the sorted order is discarded; uniqueUserActivities is built from the unsorted reversed iterable. Build a mutable list first, sort it, then filter/take from that list so the result order is deterministic and matches the intent.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 714e905. Now builds a mutable list first, sorts it in-place by date descending (b.date.compareTo(a.date)), then filters for unique activities — removing the .reversed call and the discarded temporary sort.

Comment thread pubspec.yaml
Comment on lines 71 to 75
sentry_flutter: ^8.14.2

supabase_flutter: ^2.8.2
intl_translation: ^0.20.1

Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intl_translation is added under regular dependencies, which will ship it in the runtime app even though it's only used for localization code generation. Move it under dev_dependencies (and keep the runtime depending on intl / generated files) to reduce app size and avoid pulling build-time tooling into production.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 5d221fc. Moved intl_translation: ^0.20.1 from dependencies to dev_dependencies so it won't be bundled into the production app.

Comment on lines +64 to +69
mainImageUrl: oldMealEntity.mainImageUrl,
mealQuantity: mealQuantityText.toStringOrNull(),
mealUnit: unitText,
servingQuantity: servingQuantityText.toDoubleOrNull(),
servingUnit: servingQuantityText.toStringOrNull(),
servingSize: oldMealEntity.servingSize,
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In createNewMealEntity, servingUnit is set from servingQuantityText (a numeric string), which will store values like "30" where a unit like "g"/"ml" is expected. Use the actual unit input (likely unitText or oldMealEntity.servingUnit) and keep servingQuantity/servingUnit sourced from the correct fields.

Copilot uses AI. Check for mistakes.
Comment thread lib/features/add_meal/data/data_sources/off_data_source.dart
Comment thread .metadata Outdated
Comment thread GettingStarted.md Outdated
Comment thread GettingStarted.md Outdated
Comment thread GettingStarted.md Outdated
Comment thread GettingStarted.md Outdated
Agent-Logs-Url: https://github.com/simonoppowa/OpenNutriTracker/sessions/1e5e8a2d-5296-4ff0-b5a9-9d4d9a0414f4

Co-authored-by: simonoppowa <24407484+simonoppowa@users.noreply.github.com>
simonoppowa and others added 2 commits April 12, 2026 21:44
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@simonoppowa simonoppowa merged commit d470545 into main Apr 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants